#include "PortaCanetasCamila.h"
#include <GL/glu.h>
#include <GL/gl.h>
#include "gllib/Objects.h"
#include <math.h>

void PortaCanetasCamila::draw() {
    glPushMatrix();
    glColor3f(0.0, 0.0, 0.0);
    glTranslatef(0.0, 0.35, 0.0);
    glScalef(1.0, 12.0, 1.0);
    gllibTorus(0.03, 0.4, 10, 10);
    glPopMatrix();

    glPushMatrix();
    glColor3f(0.0, 0.0, 0.0);
    gllibCylinder(0.4, 0.01, 10);
    glPopMatrix();

    glPushMatrix();
    glTranslatef(-0.1, 0.6, 0.0);
    glRotatef(10, 0.0, 0.0, 1.0);
    caneta();
    glPopMatrix();

    glPushMatrix();
    glTranslatef(0.2, 0.6, 0.0);
    glRotatef(180, 1.0, 0.0, 0.0);
    caneta();
    glPopMatrix();
}

void PortaCanetasCamila::caneta(){
    glPushMatrix();
    glColor3f(0.0, 0.0, 1.0);
    //glTranslatef(0.0, 1.0, 0.0);
    gllibCylinder(0.03, 0.95, 20);
    glPopMatrix();

    glPushMatrix();
    glColor3f(0.0, 0.0, 1.0);
    glTranslatef(0.0, 0.49, 0.0);
    gllibCylinder(0.058, 0.05, 20);
    glPopMatrix();

    glPushMatrix();
    glColor3f(0.0, 0.0, 1.0);
    glTranslatef(0.0, -0.5, 0.0);
    //glRotatef(180, 1.0, 0.0, 0.0);
    gllibSphere(0.07, 10);
    glPopMatrix();

    glPushMatrix();
    glColor3f(0.0, 0.0, 1.0);
    glTranslatef(0.0, -0.4, 0.0);
    glRotatef(180, 1.0, 0.0, 0.0);
    gllibCylinder(0.07, 0.2, 20);
    glPopMatrix();

    glPushMatrix();
    glColor3f(0.0, 0.0, 1.0);
    glTranslatef(0.06, -0.3, 0.0);
    glScalef(0.5, 2.0, 0.5);
    gllibCube(0.1);
    glPopMatrix();

    glPushMatrix();
    glColor4f(1.0,1.0,1.0, 0.3);
    gllibCylinder(0.06, 1.0, 20);
    glEnable(GL_BLEND);
    glPopMatrix();
}
